#ifndef __S_CARTASK_H
#define __S_CARTASK_H

#include "S_PID.h"
#include "S_MPU9250.h"
#include "inv_mpu.h"
#include "S_MOTOR.h"

#define STRAIGHT 0
#define TURN 1
#define ROUND 2

typedef struct Mession_t
{
	uint8_t isdoing;//是否正在运行
	uint8_t isdone;//是否执行完毕
	uint8_t type;//运行的种类0直线，1转弯，2圆弧
	float distance;//直线的距离
	float angle;//转弯角度
	float radius;//圆弧半径
	float theta;//圆弧角度
	int16_t redo;//重复次数

	struct Mession_t *next;
} Mession_t;

void ShowMeMessionList(Mession_t *head);
void FreeMessionList(Mession_t *head);
Mession_t *CreateMessionListFromArray(Mession_t *array,uint8_t len);
Mession_t *CreateMessionListFromUART(void);
Mession_t *CreateMessionListFromStr(char *str);
uint8_t RunTask(Mession_t *head);

#endif